
<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>添加佰林の预定信息</title>
    <link rel="stylesheet" href="/common/layui/css/layui.css">
    <link rel="stylesheet" href="/admin/css/style.css">
    <script src="/common/layui/layui.js"></script>
    <script src="/common/jquery-3.3.1.min.js"></script>
    <script src="/common/vue.min.js"></script>
</head>
<body>
<div id="app" class="main">
    <!--左侧数据 -->
    <div id="fixedData">
        <!--顶栏-->
        <header>
            <h1 v-text="webname"></h1>
            <div class="breadcrumb">
                <i class="layui-icon">&#xe715;</i>
                <ul>
                    <li v-for="vo in address">
                        <a  v-text="vo.name" :href="vo.url" ></a> <span>/</span>
                    </li>
                </ul>
            </div>
        </header>
        <!--左栏-->
        <div class="left">
            <ul class="cl" >
                <!--顶级分类-->
                <li v-for="vo,index in menu" :class="{hidden:vo.hidden}">
                    <a href="javascript:;"  :class="{active:vo.active}"  @click="onActive(index)">
                        <i class="layui-icon" v-html="vo.icon"></i>
                        <span v-text="vo.name"></span>
                        <i class="layui-icon arrow" v-show="vo.url.length==0">&#xe61a;</i> <i v-show="vo.active" class="layui-icon active">&#xe623;</i>
                    </a>
                    <!--子级分类-->
                    <div v-for="vo2,index2 in vo.list">
                        <a href="javascript:;" :class="{active:vo2.active}" @click="onActive(index,index2)" v-text="vo2.name"></a>
                        <i v-show="vo2.active" class="layui-icon active">&#xe623;</i>
                    </div>
                </li>
            </ul>
        </div>
    </div>
    <!--右侧-->
    <div id="Right" class="right">
        <fieldset class="layui-elem-field layui-field-title">
            <legend>添加预订信息</legend>
        </fieldset>


        <form class="layui-form " action="">
            <div class="layui-form-item">
                <label class="layui-form-label">预定时间段</label>
                <div class="layui-input-block">
                    <input type="text" name="reserveTime" required lay-verify="required" placeholder="" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">餐位类型</label>
                <div class="layui-input-inline" style="width: 200px">
                    <select name="roomType" >
                        <option value="包房">包房</option>
                        <option value="大厅">大厅</option>
                        <option value="VIP包房">VIP包房</option>
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">餐位号</label>
                <div class="layui-input-block">
                    <input type="text" name="tableNum" required lay-verify="required" placeholder="" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit lay-filter="formDemo">立即添加</button>
                </div>
            </div>
        </form>

    </div>
</div>
<script src="/admin/js/config.js"></script>
<script>
    let right = new Vue({
        el:'#Right',
        data: {
            webname:webname,
            menu:[],
            address:[],
        },
        methods:{

        },
        mounted(){
        },
    })

</script>

<script>
    //下拉选
    layui.use('form', function () {
        var form = layui.form;
        //监听提交
        form.on('submit(formDemo)', function (data) {
            console.log(data,'data')
            // layer.msg(JSON.stringify(data.field));
            $.ajax({
                url:'reserve/insert',
                type:'post',
                data:JSON.stringify(data.field),
                contentType: "application/json;charset=UTF-8",
                success: (data)=> {
                    if(data == 1){
                        alert('预订信息添加成功！');
                    }else{
                        alert("预订信息添加失败！");
                    }
                }

            })
            console.log(1233)
            return false;
        });
    });
</script>
</body>
</html>
